import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '是否删除',
		align: "center",
		dataIndex: 'trash'
	},
	{
		title: '状态：Finish- 已完成  AllRefund -全部退款，RebatesRefund-部分退款',
		align: "center",
		dataIndex: 'stats'
	},
	{
		title: '旅行社id',
		align: "center",
		dataIndex: 'travelid'
	},
	{
		title: '导入或导出：import-导入，export-导出',
		align: "center",
		dataIndex: 'importorexport'
	},
	{
		title: '行程',
		align: "center",
		dataIndex: 'travelgroupid'
	},
	{
		title: '未付金额',
		align: "center",
		dataIndex: 'unpaidprice'
	},
	{
		title: '已付金额',
		align: "center",
		dataIndex: 'paidpirce'
	},
	{
		title: '实际金额：单位分',
		align: "center",
		dataIndex: 'actualprice'
	},
	{
		title: '利润：单位分',
		align: "center",
		dataIndex: 'profit'
	},
	{
		title: '市场价：单位分',
		align: "center",
		dataIndex: 'totalprice'
	},
	{
		title: '创建时间',
		align: "center",
		dataIndex: 'createtime'
	},
	{
		title: '订单和用map：',
		align: "center",
		dataIndex: 'orderanduser'
	},
	{
		title: '其它信息',
		align: "center",
		dataIndex: 'extinfors'
	},
];
//查询数据
export const searchFormSchema : FormSchema[] = [
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '是否删除',
		field: 'trash',
		component: 'Input',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入是否删除!' },
			];
		},
	},
	{
		label: '状态：Finish- 已完成  AllRefund -全部退款，RebatesRefund-部分退款',
		field: 'stats',
		component: 'Input',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入状态：Finish- 已完成  AllRefund -全部退款，RebatesRefund-部分退款!' },
			];
		},
	},
	{
		label: '旅行社id',
		field: 'travelid',
		component: 'Input',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入旅行社id!' },
			];
		},
	},
	{
		label: '导入或导出：import-导入，export-导出',
		field: 'importorexport',
		component: 'Input',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入导入或导出：import-导入，export-导出!' },
			];
		},
	},
	{
		label: '行程id',
		field: 'travelgroupid',
		component: 'Input',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入行程id!' },
			];
		},
	},
	{
		label: '未付金额',
		field: 'unpaidprice',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入未付金额!' },
			];
		},
	},
	{
		label: '已付金额',
		field: 'paidpirce',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入已付金额!' },
			];
		},
	},
	{
		label: '实际金额：单位分',
		field: 'actualprice',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入实际金额：单位分!' },
			];
		},
	},
	{
		label: '利润：单位分',
		field: 'profit',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入利润：单位分!' },
			];
		},
	},
	{
		label: '市场价：单位分',
		field: 'totalprice',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入市场价：单位分!' },
			];
		},
	},
	{
		label: '创建时间',
		field: 'createtime',
		component: 'InputNumber',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入创建时间!' },
			];
		},
	},
	{
		label: '订单和用map',
		field: 'orderanduser',
		component: 'InputTextArea',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入订单和用map：旅行社id和行程id相同的存一条数据!'},
			];
		},
	},
	{
		label: '其它信息',
		field: 'extinfors',
		component: 'InputTextArea',
		dynamicRules: ({ model, schema }) => {
			return [
				{ required: true, message: '请输入其它信息!' },
			];
		},
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}